Skip to content

Handle new Transformers v5 return type#3353

Draft
rootonchair wants to merge 1 commit intoLightning-AI:masterfrom
rootonchair:fix/transformers-v5-output
Draft

Handle new Transformers v5 return type#3353
rootonchair wants to merge 1 commit intoLightning-AI:masterfrom
rootonchair:fix/transformers-v5-output

Conversation

@rootonchair
Copy link
Copy Markdown

@rootonchair rootonchair commented Apr 2, 2026

What does this PR do?

Transformers new return BaseModelOutputWithPooling for get_text_features, get_image_features which cause AttributeError when we call a function available on Tensor

AttributeError: 'BaseModelOutputWithPooling' object has no attribute 'norm'
Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?
PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃


📚 Documentation preview 📚: https://torchmetrics--3353.org.readthedocs.build/en/3353/

@bhimrazy
Copy link
Copy Markdown
Collaborator

bhimrazy commented Apr 9, 2026

Thanks @rootonchair for the PR. We will come back to it. Currently, we do not have the setup to test with the newest transformer version, but we will look into it soon. Thanks for your patience.

In the meantime, if you could add more context to the PR description and link to some relevant references, that would be helpful.

@bhimrazy bhimrazy marked this pull request as draft April 9, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants